<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
<HTML>
<HEAD>
<TITLE></TITLE>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
<link rel="stylesheet" type="text/css" href="../Meta.css">
</HEAD>
<BODY>
<H1>BadProcedureException</H1>
<H2>What it means</H2>
<P>This means the program tried to call something that wasn't a procedure.&nbsp; 
The <FONT face=Arial>offendingProcedure</FONT> field tells you what object the 
program had attempted to "call".</P>
<H2>What causes it</H2>
<UL>
  <LI>Ususally, this means you typed something like:</LI></UL>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <P><FONT face=Arial>[</FONT><EM>op arg</EM><SUB>1</SUB><EM> ... 
    arg</EM><SUB>n</SUB><FONT face=Arial>]</FONT></P></BLOCKQUOTE>
  <P dir=ltr>or:</P>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <P dir=ltr><FONT face=Arial>[apply</FONT> <EM>op list</EM><FONT 
    face=Arial>]</FONT></P></BLOCKQUOTE>
  <P dir=ltr>when the expressoin <EM>op</EM> doesn't evaluate to a procedure 
  object.</P></BLOCKQUOTE>
<UL dir=ltr>
  <LI>
  <DIV>This can happen when you use a local variable or argument that has the 
  same name as the global variable the procedure is bound to.&nbsp; In that 
  case, the local variable "shadows" the global variable, and you end up calling 
  the value of the local variable instead of the desired global variable.&nbsp; 
  For example, if you write a procedure that has an argument called "<FONT 
  face=Arial>new</FONT>" and then try to call the <FONT face=Arial>new</FONT> 
  procedure.&nbsp; If can also happen if you use a local variable with the same 
  name as a special form like <FONT face=Arial>if</FONT> or <FONT 
  face=Arial>lambda</FONT>.</DIV></LI>
  <LI>
  <DIV>Once in a while, it can happen because you accidentally change a variable 
  that used to be bound to a procedure to some other value.</DIV></LI>
  <LI>
  <DIV>Finally, it can also occur when you pass an argument to a procedure such 
  as <FONT face=Arial>map</FONT> that takes other procedures for one or more of 
  its arguments.</DIV></LI></UL>
<H2 dir=ltr>What to do</H2>
<P dir=ltr>Find the location of the failure.</P>
<UL dir=ltr>
  <LI>
  <DIV>If the failure is inside a call to a primitive procedure such as <FONT 
  face=Arial>map</FONT>, then you probably pass an invalid argument to the 
  procedure.&nbsp; Check the arguments and their order.</DIV></LI>
  <LI>
  <DIV>If the failure is inside an application expression, then the operator 
  portion of it evaluated to something other than a procedure. Example the 
  expression to figure out why.</DIV></LI></UL>



</BODY>
</HTML>
